package Cantella::DJabberd::Web;

use strict;
use warnings;

use Catalyst::Runtime '5.70';
use Catalyst qw(
                 ConfigLoader
                 Dumper
                 Static::Simple
                 I18N
                 Session
                 Session::Store::FastMmap
                 Session::State::Cookie
              );

#                Authentication
#                Authorization::ACL
#                Authorization::Roles

our $VERSION = '0.01';

__PACKAGE__->config( name => 'Cantella::DJabberd::Web' );

__PACKAGE__->config->{View}->{Site}->{skin_name} = 'default_xyz';

#  __PACKAGE__->config->{authentication} =
#   { default_realm => 'users',
#     realms =>
#     { users =>
#       { credential => {class => 'Password', password_type => 'self_check'},
#         store => { class => '+Cantella::DJabberd::Web::Plugin::Authentication::Store' }
#       }
#     }
#   };

sub current_user {
  my $self = shift;
  $self->model('Admin')->current_user;
}

sub has_current_user {
  my $self = shift;
  $self->model('Admin')->has_current_user;
}

# Start the application
__PACKAGE__->setup;

1;
